# -*- coding: utf8 -*-

<%inherit file="../autohandler"/>
<%include file="toolPanel.myt"/>
<%include file="searchPanel.myt"/>
<table width="90%" border="0" align="center" cellpadding="0" cellspacing="1">
  <tr><td><div id="add" /></td></tr>
</table>
<table id="tbContent" width="90%" border="0" align="center" cellpadding="0" cellspacing="1" class="BoxCenter">
  <tr class="headlineTextCenter">
    <td height="20" bgcolor="#C5CED9" width="5%" onClick="location='/biblio/sort?n=id'">№</td>
    <td height="20" bgcolor="#C5CED9" width="50%" onClick="location='/biblio/sort?n=name'">Наименование</td>
    <td height="20" bgcolor="#C5CED9" width="22%" onClick="location='/biblio/sort?n=author'">Автор</td>
    <td height="20" bgcolor="#C5CED9" width="8%" onClick="location='/biblio/sort?n=year'">Год выпуска</td>
    <td height="20" bgcolor="#C5CED9" colspan="3" width="2%">Действия</td>
  </tr>
  <tr id="trNew"><td colspan="8">
      <div id="divNewItem"></div>
      <div id="divNewShowEdit"></div></td>
  </tr>
  <tr bgcolor="#F0F0F0"></tr>
%if c.biblioPosts is not None:
% for post in c.biblioPosts:

  <tr bgcolor="#F0F0F0">
    <td height="20" class="bodyText">${post.id}</td>
    <td height="20" class="bodyText">
        ${ h.link_to_remote(post.name, dict(update="fullview%s" % post.id, url=h.url_for(action='fullview/%s' % post.id)))}
    </td>
    <%
        if post.author is None:
            post.author = ''

        if post.year is None:
            post.year = ''
    %>
    <td height="20" class="bodyText">${post.author}</td>
    <td height="20" class="bodyText">${post.year}</td>
    <td height="20" class="bodyText">
        <a href="#" onclick="new Ajax.Updater('fullview${post.id}', '/biblio/order/${post.id}', {asynchronous:true, evalScripts:true}); return false">
            <img border='0' src='/img/b_order.png' title='Заказать' alt='Заказать' width='16' height='16'>
        </a>
        <!--a href="/biblio/order/${post.id}" onclick="return confirm('Оформить заказ для текущего пользователя (\'${c.user_name}\')');">
            <img border='0' src='/img/b_order.png' title='Заказать' alt='Заказать' width='16' height='16'>
        </a-->
    </td>
    <td height="20" class="bodyText">
        <a href="#" onclick="new Ajax.Updater('fullview${post.id}', '/biblio/edit/${post.id}', {asynchronous:true, evalScripts:true}); return false;">
            <img border='0' src='/img/b_props.png' title='Редактировать запись' alt='Редактировать' width='16' height='16'>
        </a>
    </td>
    <td height="20" class="bodyText">
        <a href="#" onclick="new Ajax.Updater('fullview${post.id}', '/biblio/delete/${post.id}', {asynchronous:true, evalScripts:true}); return false;">
            <img border='0' src='/img/b_delrec.png' title='Удалить запись' alt='Удалить' width='16' height='16'>
        </a>
    </td>
  </tr>
  <tr id="trShowEdit${post.id}">
      <td colspan="8" id="td${post.id}">
          <div id="fullview${post.id}" />
  </td></tr>
  
% endfor
%endif
</table>
<%include file="toolPanel.myt"/>

